<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>switch选择结构</title>
</head>

<body>
    <script>

        // 输入考试名次，第一名奖励电脑，第二名奖励手机，第三名奖励MP4，第四名奖励MP3 否则没有奖励
        
        var mc = parseInt(prompt('请输入名次：'))
        if (mc === 1) {
            console.log('奖励电脑');
        } else if (mc === 2) {
            console.log('奖励手机');
        } else if (mc === 3) {
            console.log('奖励MP4');
        } else if (mc === 4) {
            console.log('奖励mp3');
        } else {
            console.log('没有奖励，你真垃圾！');
        }

    </script>
</body>

</html>